package com.disability_federation.controller;

import com.disability_federation.mapper.MapperAmountsAccountsCollection;
import com.disability_federation.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 残保金征收账目操作接口
 */
@RestController
@CrossOrigin
public class ControllerAmountsAccountsCollection {

    @Autowired
    private MapperAmountsAccountsCollection mapperAmountsAccountsCollection;

    /**
     * 查询全部残保金征收账目
     * 默认时间升序排序
     */
    @RequestMapping("AAC/query")
    public Result query(){
        return Result.success(mapperAmountsAccountsCollection.query());
    }

    /**
     * 查询全部残保金征收账目
     * 时间降序排序
     */
    @RequestMapping("AAC/query/time_desc")
    public Result queryDesc(){
        return Result.success(mapperAmountsAccountsCollection.queryDesc());
    }

    /**
     * 查询全部残保金征收账目
     * 名称升序排序
     */
    @RequestMapping("AAC/query/enterprise_asc")
    public Result queryEnterpriseAsc(){
        return Result.success(mapperAmountsAccountsCollection.queryEnterpriseAsc());
    }

    /**
     * 查询全部残保金征收账目
     * 名称降序排序
     */
    @RequestMapping("AAC/query/enterprise_desc")
    public Result queryEnterpriseDesc(){
        return Result.success(mapperAmountsAccountsCollection.queryEnterpriseDesc());
    }

    /**
     * 条件查询残保金征收账目
     * 默认名称升序排序
     */
    @RequestMapping("AAC/queryByCondition")
    public Result queryByCondition(String enterprise){
        return Result.success(mapperAmountsAccountsCollection.queryByCondition(enterprise));
    }

    /**
     * 条件查询残保金征收账目
     * 名称降序排序
     */
    @RequestMapping("AAC/queryByCondition/enterprise_desc")
    public Result queryByConditionDesc(String enterprise){
        return Result.success(mapperAmountsAccountsCollection.queryByConditionDesc(enterprise));
    }

}
